------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/006489466/Desktop/CA OIS/TSResults.log
  log type:  text
 opened on:  19 Sep 2023, 11:34:03

. 
. use "/Users/006489466/Desktop/CA OIS/WaPoDataCA.dta"

. 
end of do-file

. do "/var/folders/rm/04tctgtx0bxg5jlm6dfv1ql80000gr/T//SD36832.000000"

. tsline ois, tline(2020m1) yline(11.91)

. 
end of do-file

. do "/var/folders/rm/04tctgtx0bxg5jlm6dfv1ql80000gr/T//SD36832.000000"

. *horizontal dashed line = average for entire series
. * vertical dashed line shows when law went into effect.
. 
. 
. * let's do some analysis
. * check for stationarity
. dfuller ois

Dickey–Fuller test for unit root           Number of obs  = 95
Variable: ois                              Number of lags =  0

H0: Random walk without drift, d = 0

                                       Dickey–Fuller
                   Test      -------- critical value ---------
              statistic           1%           5%          10%
--------------------------------------------------------------
 Z(t)            -8.151       -3.517       -2.894       -2.582
--------------------------------------------------------------
MacKinnon approximate p-value for Z(t) = 0.0000.

. * no unit root; stationary
. pperron ois

Phillips–Perron test for unit root        Number of obs   = 95
Variable: ois                             Newey–West lags =  3

H0: Random walk without drift, d = 0

                                       Dickey–Fuller
                   Test      -------- critical value ---------
              statistic           1%           5%          10%
--------------------------------------------------------------
 Z(rho)         -91.365      -19.710      -13.660      -10.970
 Z(t)            -8.325       -3.517       -2.894       -2.582
--------------------------------------------------------------
MacKinnon approximate p-value for Z(t) = 0.0000.

. *no unit root; stationar
. 
. * checking for autocorrelations
. ac ois

. * all lags w/i 95% CI
. pac ois 

. * all lags w/it 95% CI
. 
. 
. regress ois

      Source |       SS           df       MS      Number of obs   =        96
-------------+----------------------------------   F(0, 95)        =      0.00
       Model |           0         0           .   Prob > F        =         .
    Residual |  1510.15625        95  15.8963816   R-squared       =    0.0000
-------------+----------------------------------   Adj R-squared   =    0.0000
       Total |  1510.15625        95  15.8963816   Root MSE        =     3.987

------------------------------------------------------------------------------
         ois | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
       _cons |   11.90625   .4069242    29.26   0.000      11.0984     12.7141
------------------------------------------------------------------------------

. estat sbcusum

Cumulative sum test for parameter stability

Sample: 2015m1 thru 2022m12                 Number of obs = 96
H0: No structural break

                   Test      -------- Critical value ---------
      Type    statistic           1%           5%          10%
--------------------------------------------------------------
 Recursive       0.8871       1.1430       0.9479       0.8499
--------------------------------------------------------------

. estat dwatson

Durbin–Watson d-statistic(  1,    96) =  1.679296

. estat bgodfrey

Breusch–Godfrey LM test for autocorrelation
---------------------------------------------------------------------------
    lags(p)  |          chi2               df                 Prob > chi2
-------------+-------------------------------------------------------------
       1     |          1.457               1                   0.2275
---------------------------------------------------------------------------
                        H0: no serial correlation

. *no  sign of correlation. no sign of breaks in data either
. 
. * complexity not warranted; only one observed state
. mswitch dr ois i.month, vce(robust) states(1)

Performing EM optimization:

Performing gradient-based optimization:

Iteration 0:   log pseudolikelihood = -263.58868  
Iteration 1:   log pseudolikelihood = -263.58868  (backed up)

Markov-switching dynamic regression

Sample:  2015m1 thru 2022m12                            Number of obs =     96
Number of states = 1                                    AIC           = 5.7623
                                                        HQIC          = 5.9026
                                                        SBIC          = 6.1095
Log likelihood = -263.58868

------------------------------------------------------------------------------
             |               Robust
         ois | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
ois          |
       month |
          1  |          0  (empty)
          2  |      -1.25   1.357727    -0.92   0.357    -3.911095    1.411095
          3  |      1.875   1.783145     1.05   0.293      -1.6199      5.3699
          4  |        .25   1.558086     0.16   0.873    -2.803793    3.303793
          5  |       .125   1.871708     0.07   0.947     -3.54348     3.79348
          6  |       .875   1.615916     0.54   0.588    -2.292137    4.042137
          7  |          2   1.862723     1.07   0.283     -1.65087     5.65087
          8  |        2.5   1.735466     1.44   0.150    -.9014514    5.901451
          9  |         -1   1.775936    -0.56   0.573     -4.48077     2.48077
         10  |      1.875   1.911358     0.98   0.327    -1.871193    5.621193
         11  |         -1   1.474788    -0.68   0.498    -3.890532    1.890532
         12  |       .125    2.19044     0.06   0.954    -4.168183    4.418183
             |
       _cons |     11.375   1.108876    10.26   0.000     9.201643    13.54836
-------------+----------------------------------------------------------------
       sigma |   3.768876   .2954574                      3.232085    4.394819
------------------------------------------------------------------------------

. 
. mswitch dr ois i.month, vce(robust) states(2)

Performing EM optimization:

Performing gradient-based optimization:

Iteration 0:   log pseudolikelihood = -258.63878  
Iteration 1:   log pseudolikelihood = -257.46358  
Iteration 2:   log pseudolikelihood =  -257.1015  
Iteration 3:   log pseudolikelihood = -257.08927  
Iteration 4:   log pseudolikelihood = -257.08927  

Markov-switching dynamic regression

Sample:  2015m1 thru 2022m12                            Number of obs =     96
Number of states = 2                                    AIC           = 5.6894
Unconditional probabilities: transition                 HQIC          = 5.8621
                                                        SBIC          = 6.1168
Log likelihood = -257.08927

------------------------------------------------------------------------------
             |               Robust
         ois | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
ois          |
       month |
          1  |          0  (empty)
          2  |  -1.069871   1.250985    -0.86   0.392    -3.521756    1.382014
          3  |   1.247277   1.438591     0.87   0.386    -1.572309    4.066863
          4  |  -.2203439   1.486653    -0.15   0.882     -3.13413    2.693443
          5  |  -.5017874     1.6131    -0.31   0.756    -3.663405     2.65983
          6  |   .4387856   1.661882     0.26   0.792    -2.818443    3.696014
          7  |   1.367937   1.720545     0.80   0.427     -2.00427    4.740144
          8  |   1.824629   1.864781     0.98   0.328    -1.830274    5.479532
          9  |  -1.659325   1.538735    -1.08   0.281    -4.675191    1.356541
         10  |   .9918113   1.710638     0.58   0.562    -2.360977    4.344599
         11  |   -1.64442   1.337099    -1.23   0.219    -4.265086     .976245
         12  |  -.5080085   1.864142    -0.27   0.785     -4.16166    3.145643
-------------+----------------------------------------------------------------
State1       |
       _cons |   11.05112   1.156098     9.56   0.000     8.785209    13.31703
-------------+----------------------------------------------------------------
State2       |
       _cons |   18.50493   1.617997    11.44   0.000     15.33371    21.67614
-------------+----------------------------------------------------------------
       sigma |   2.962065    .344025                      2.359027    3.719257
-------------+----------------------------------------------------------------
         p11 |   .9531799    .036607                      .8031015    .9902548
-------------+----------------------------------------------------------------
         p21 |   .3837009   .1962989                      .1090145    .7600783
------------------------------------------------------------------------------

. estat transition

Number of obs = 96          
------------------------------------------------------------------------------
    Transition probabilities |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
                         p11 |   .9531799    .036607      .8031015    .9902548
-----------------------------+------------------------------------------------
                         p12 |   .0468201    .036607      .0097452    .1968985
-----------------------------+------------------------------------------------
                         p21 |   .3837009   .1962989      .1090145    .7600783
-----------------------------+------------------------------------------------
                         p22 |   .6162991   .1962989      .2399217    .8909855
------------------------------------------------------------------------------

. estat duration

Number of obs = 96          
------------------------------------------------------------------------------
           Expected duration |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
                      State1 |   21.35837   16.69935      5.078759     102.615
-----------------------------+------------------------------------------------
                      State2 |   2.606197   1.333314      1.315654     9.17309
------------------------------------------------------------------------------

. 
. mswitch dr ois i.month, vce(robust) states(3)

Performing EM optimization:

Performing gradient-based optimization:

Iteration 0:   log pseudolikelihood = -257.23433  (not concave)
Iteration 1:   log pseudolikelihood = -257.04188  (not concave)
Iteration 2:   log pseudolikelihood = -256.95837  (not concave)
Iteration 3:   log pseudolikelihood = -256.84089  (not concave)
Iteration 4:   log pseudolikelihood = -256.79276  (not concave)
Iteration 5:   log pseudolikelihood = -256.49572  (not concave)
Iteration 6:   log pseudolikelihood = -255.86086  (not concave)
Iteration 7:   log pseudolikelihood = -255.54615  (not concave)
Iteration 8:   log pseudolikelihood = -255.07277  (not concave)
Iteration 9:   log pseudolikelihood = -254.56171  
Iteration 10:  log pseudolikelihood = -254.23881  
Iteration 11:  log pseudolikelihood = -254.17667  
Iteration 12:  log pseudolikelihood =  -254.1624  
Iteration 13:  log pseudolikelihood = -254.15942  
Iteration 14:  log pseudolikelihood = -254.15892  
Iteration 15:  log pseudolikelihood = -254.15881  
Iteration 16:  log pseudolikelihood = -254.15878  
Iteration 17:  log pseudolikelihood = -254.15877  
Iteration 18:  log pseudolikelihood = -254.15877  
Iteration 19:  log pseudolikelihood = -254.15877  

Markov-switching dynamic regression

Sample:  2015m1 thru 2022m12                            Number of obs =     96
Number of states = 3                                    AIC           = 5.7325
Unconditional probabilities: transition                 HQIC          = 5.9592
                                                        SBIC          = 6.2934
Log likelihood = -254.15877

------------------------------------------------------------------------------
             |               Robust
         ois | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
ois          |
       month |
          1  |          0  (empty)
          2  |  -1.165993   1.157045    -1.01   0.314     -3.43376    1.101774
          3  |   .9512588    1.17922     0.81   0.420    -1.359969    3.262487
          4  |  -.5664715   1.313595    -0.43   0.666    -3.141071    2.008128
          5  |  -.7480761   1.345827    -0.56   0.578    -3.385849    1.889697
          6  |   .2033927   1.590465     0.13   0.898    -2.913862    3.320648
          7  |   .8374854   1.656385     0.51   0.613     -2.40897    4.083941
          8  |   1.344449   1.683724     0.80   0.425     -1.95559    4.644487
          9  |  -2.020446   1.293225    -1.56   0.118    -4.555121    .5142293
         10  |    .868181   1.552505     0.56   0.576    -2.174672    3.911034
         11  |  -1.874347    1.17894    -1.59   0.112    -4.185028    .4363334
         12  |  -.6987951   1.659535    -0.42   0.674    -3.951423    2.553833
-------------+----------------------------------------------------------------
State1       |
       _cons |   10.31855   .9310945    11.08   0.000     8.493634    12.14346
-------------+----------------------------------------------------------------
State2       |
       _cons |   12.55555   1.121085    11.20   0.000     10.35827    14.75284
-------------+----------------------------------------------------------------
State3       |
       _cons |   19.05939   1.276033    14.94   0.000     16.55841    21.56037
-------------+----------------------------------------------------------------
       sigma |   2.754633   .2292485                      2.340045    3.242673
-------------+----------------------------------------------------------------
         p11 |   .9314905   .0501205                      .7446874    .9844673
         p12 |   2.83e-10   1.24e-09                      5.16e-14    1.55e-06
-------------+----------------------------------------------------------------
         p21 |   .0658798   .0372673                      .0210683    .1877261
         p22 |   .9341202   .0372673                      .8122739    .9789317
-------------+----------------------------------------------------------------
         p31 |   .1453092   .1484314                      .0160742    .6388976
         p32 |   .2110698   .1216303                       .060081    .5282505
------------------------------------------------------------------------------

. estat transition

Number of obs = 96          
------------------------------------------------------------------------------
    Transition probabilities |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
                         p11 |   .9314905   .0501205      .7446874    .9844673
-----------------------------+------------------------------------------------
                         p12 |   2.83e-10   1.24e-09      5.16e-14    1.55e-06
-----------------------------+------------------------------------------------
                         p13 |   .0685095   .0501205      .0155327    .2553126
-----------------------------+------------------------------------------------
                         p21 |   .0658798   .0372673      .0210683    .1877261
-----------------------------+------------------------------------------------
                         p22 |   .9341202   .0372673      .8122739    .9789317
-----------------------------+------------------------------------------------
                         p23 |   1.10e-09   7.76e-09      1.12e-15     .001087
-----------------------------+------------------------------------------------
                         p31 |   .1453092   .1484314      .0160742    .6388976
-----------------------------+------------------------------------------------
                         p32 |   .2110698   .1216303       .060081    .5282505
-----------------------------+------------------------------------------------
                         p33 |   .6436211   .1646933      .3065777    .8806289
------------------------------------------------------------------------------

. estat duration

Number of obs = 96          
------------------------------------------------------------------------------
           Expected duration |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
                      State1 |   14.59651   10.67857     -6.333108    35.52613
-----------------------------+------------------------------------------------
                      State2 |   15.17917   8.586656     -1.650369     32.0087
-----------------------------+------------------------------------------------
                      State3 |   2.806002   1.296737      .2644448    5.347559
------------------------------------------------------------------------------

. 
. 
. *fit stats aren't different across models. conclude one state and no breaks
. *w/i the data.
. 
. log close
      name:  <unnamed>
       log:  /Users/006489466/Desktop/CA OIS/TSResults.log
  log type:  text
 closed on:  19 Sep 2023, 11:34:35
------------------------------------------------------------------------------------
